package com.kingwang.training.ooad.coffeemaker.goodway;

/**
 * @author King
 */
public abstract class HotWaterSource {
    private UserInterface ui;
    private ContainmentVessel containmentVessel;

    protected boolean brewing;

    public HotWaterSource() {
        this.brewing = false;
    }

    public void init(UserInterface ui, ContainmentVessel containmentVessel) {
        this.ui = ui;
        this.containmentVessel = containmentVessel;
    }

    public void start() {
        this.brewing = true;
        startBrewing();
    }

    public void done() {
        this.brewing = false;
    }

    protected void declareDone() {
        this.ui.done();
        this.containmentVessel.done();
        done();
    }

    public abstract Boolean isReady();

    public abstract void startBrewing();

    public abstract void pause();

    public abstract void resume();
}
